package com.health.memberbackstage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.memberbackstage.pojo.Ordersetting;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.sql.Date;

public interface OrdersettingMapper extends BaseMapper<Ordersetting> {

    @Select("select * from ordersetting where orderdate = #{healthDate}")
    Ordersetting selectByOrderdateInteger(Date healthDate);

    @Update("update ordersetting set reservations = reservations + 1, `version` = `version` +1 where orderdate = #{orderdate} and `version` = #{version}")
    int updateReservations(@Param("orderdate") Date healthDate,@Param("version") Integer version);
}
